#pragma once

#include "Containers/String.h"
#include "Containers/Vector.h"

#include "FunctionID.h"
#include "DecoratedType.h"

class CFunction;
class CType;

class CFunctionList
{
public:
    CFunctionList(CType* InParentType)
    {
        ParentType = InParentType;
    }

    CType * GetParentType()
    {
        return ParentType;
    }
protected:
    CType* ParentType;

public:


	//add function to this class
	//return function index
	uint32_t AddFunction(CFunction* InFunction)
	{
		Functions.Add(InFunction);
		return Functions.Num()-1;
	}

	TVector<CFunction*> Functions;

	CFunction* FindFunction(const CString& InFunctionName);

	CFunction* FindNativeFunction(int64_t NativeFunctionPtr);

	TVector<SFunctionID> VirtualFunctionTable;


	//indexer only used in script. allow script to get/set value like this:
	//object["indexer",0] = value;   
	struct SIndexer
	{
		CFunction* Getter; 
		CFunction* Setter;
		TVector<SDecoratedType> ParameterTypes; //parameter types of getter function
	};
	TVector<SIndexer> Indexers;

};